<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<style>
    .form-group {
        margin-top: 10px;
    }

    .staffApply {
        float: left;
        margin-left: 20px;
    }
</style>
<script>
    $(document).ready(function () {
        //手术间自动填充
    var roomId=$('#operatingRoomIdId').val();
    $('#operatingRoomNo option').remove();
    $('#operatingRoomNo').val('');
    $('#operatingRoomNo').html("<option value=''></option>");
    $.ajax({
        type: "POST",
        //url: '${ctx}/operation/operationSchedule/findRoom?deptId='+roomId,
        url: '${ctx}/operation/operationApply/findRoom?deptId='+roomId,
        dataType: "json",
        success: function (data) {
            console.log(data.dataMap);
            if(data.dataMap != null){
                var html="";
                for(var key in data.dataMap){
                    html+="<option value='"+key+"'>"+data.dataMap[key]+"</option>";
                }
                $('#operatingRoomNo').html(html);
            }
        },
        error: function (data) {
            toastr.error('网络连接错误,请检查网络');
        }
    });
    });


</script>
<script type="text/javascript">
    //手术室与手术间联动
    function changeOperatonRoom(){
        var roomId=$('#operatingRoomIdId').val();

        $('#operatingRoomNo option').remove();
        $('#operatingRoomNo').val('');
        $('#operatingRoomNo').html("<option value=''></option>");
        $.ajax({
            type: "POST",
            //url: '${ctx}/operation/operationSchedule/findRoom?deptId='+roomId,
            url: '${ctx}/operation/operationApply/findRoom?deptId='+roomId,
            dataType: "json",
            success: function (data) {
                console.log(data.dataMap);
                if(data.dataMap != null){
                    var html="";
                    for(var key in data.dataMap){
                        html+="<option value='"+key+"'>"+data.dataMap[key]+"</option>";
                    }
                    $('#operatingRoomNo').html(html);
                }
            },
            error: function (data) {
                toastr.error('网络连接错误,请检查网络');
            }
        });
    }
    //手术项目动态行
    var idNum = 0;
    var id="operName"+idNum.toString();
    function addOperationSchedule(i) {
        //idNum=$('#operationName').children('tr').length;
        var leftHtml = "";

        leftHtml += '<tr><input type="hidden" name="operationNameBefores[' + idNum + '].id"/><td><input data-parsley-required="true" id="operName'+idNum+'" name="operationNameBefores[' + idNum + '].operationName" class="form-control" cssStyle="border: none;margin:0;"/>' +
        '<input type="hidden" id="operCode'+idNum+'" name="operationNameBefores[' + idNum + '].operationCode"/><input type="hidden" id="operId'+idNum+'" name="operationNameBefores[' + idNum + '].operationId"/>'+
        <%--<c:forEach items="${operationDictList.list}" var="operationDict">
        '<option value="${operationDict.id}"  htmlEscape="false">${operationDict.operationName}</option>'+</c:forEach>--%>
        '</td><td class="col-sm-5"><select data-parsley-required="true" id="operScale'+idNum+'" name="operationNameBefores[' + idNum + '].operationScale" class="form-control"><option value=""></option>' +
        <c:forEach items="${fns:getDictList('OPERATION_SCALE')}" var="type">
        '<option value="${type.value}">${type.label}</option>' +
        </c:forEach>
        '</select></td><td class="col-sm-2"><select id="operCrade'+idNum+'" name="operationNameBefores[' + idNum + '].woundGrade" data-parsley-required="true" class="form-control"><option value=""></option>' +
        <c:forEach items="${fns:getDictList('WOUND_GRADE_DICT')}" var="type">
        '<option value="${type.value}">${type.label}</option>' +
        </c:forEach>
        '</select></td>';
        leftHtml = leftHtml + '<td><button type="button" class="btn btn-danger" onclick="delOperationApply(this)">删除</button>' +
        '</td></tr>';

        $('#operationName').append(leftHtml);
        /*console.log(leftHtml);
         console.log("operScale"+idNum);
         console.log("operCrade"+idNum);*/
        //select2Load("operName");
        select2Load("operScale"+idNum);
        select2Load("operCrade"+idNum);
        id="operName"+idNum;
        autoCompleteDrugPrice(id,idNum);
        idNum = idNum + 1;
    }
    function delOperationApply(obj) {
        $(obj).parent().parent().remove();
    }
    /*分配人员*/
    function assignButton(inputShow, inputHide) {
        var userIds = $("#" + inputHide).val();
        layerTree = layer.open({
            title: '分配人员',
            type: 2,
            area: ['500px', '520px'],
            fixed: false, //不固定
            maxmin: true,
            content: '${ctx}/sys/orgRole/usertorole?userId=' + userIds,
            btn: ['确定', '取消'],
            yes: function (index, layero) {
                var resultIds = $(layero).find("iframe")[0].contentWindow.resultIds;
                var resultNames = $(layero).find("iframe")[0].contentWindow.resultNames;
                if((inputShow=='zdName'||inputShow=='myName'||inputShow=='kdDoctorNames') && resultNames.indexOf(",") > 0){
                    layer.alert('请勿选择多个医生',{
                        icon: 2,
                        skin: 'layer-ext-moon'
                    })
                }
                else{
                    console.log(inputShow+"+++++"+inputHide);
                    $("#" + inputShow).val(resultNames);
                    $("#" + inputHide).val(resultIds);
                    layer.close(index);
                }
            }, no: function (index) {
                layer.close(index);
            }
        });
    }
    function autoCompleteDrugPrice(inputId,idNum){
        var url="${ctx}/operation/operationApply/autoCompletePrice";
        autoComplete(inputId,url,
                function(data){
                    var rows = [];
                    for(var i=0; i<data.length; i++){
                        console.log(data);
                        rows[rows.length] = {
                            data:data[i],
                            value:data[i].id,
                            result:data[i].operName
                        };
                    }
                    return rows;
                },function(data, i, max){
                    return data.operName+"|"+"|"+ Math.round(parseFloat(data.operPrice)* 100)/100+"元";
                },function(event,data,formatted){
                    console.log(data);
                    $('#'+"operCode"+idNum).attr('value',data.operCode);
                    $('#'+"operId"+idNum).attr('value',data.id);
                });
    }

</script>
<div class="content-wrap">
    <div class="wrapper" style="bottom: 50px;">
        <ul class="nav nav-tabs">
            <li class="active">
                <a href="#">
                    <c:choose>
                        <c:when test="${operationSchedule.id==''|| operationSchedule.id==null}">
                            手术列表
                        </c:when>
                        <c:otherwise>手术安排</c:otherwise>
                    </c:choose>
                </a>
            </li>
        </ul>
        <section class="main-content col-lg-12">
            <div class="content-wrap">
                <c class="panel-body">
                    <form:form id="inputForm" data-parsley-validate="" modelAttribute="operationSchedule"
                               onsubmit="return formSaveLoad('mainCenterDiv','inputForm','${ctx}/operation/operationSchedule/save','${ctx}/operation/operationSchedule/index');"
                               method="post" class="form-horizontal">
                    <c:if test="${operationState=='0'}">
                    <input type="hidden" name="applyId" value="${operationSchedule.id}"/>
                    </c:if>
                        <form:hidden path="id"/>
                    <c:if test="${operationState=='1'}">
                        <form:hidden path="applyId"/>
                    </c:if>
                        <form:hidden path="operStatus"/>
                        <form:hidden path="clinicId"/>
                            <form:hidden path="visitId"/>
                        <form:hidden path="patientId"/>
                        <form:hidden path="orgId"/>
                    <fieldset>
                        <legend><img src="${ctxStatic}/images/left.png" class="pull-left mt8">手术项目<img
                                src="${ctxStatic}/images/right.png" class="pull-right mt8"></legend>
                        <table class="table table-bordered table-striped mg-t datatable">
                            <thead>
                            <tr>
                                <td>手术名称</td>
                                <td>手术等级</td>
                                <td>切口等级</td>
                                <td>操作</td>
                            </tr>
                            </thead>
                            <tbody id="operationName">
                            <!--手术安排-->
                            <c:if test="${operationState=='0'}">
                                <c:forEach items="${operationSchedule.operationNameApplys}"
                                           varStatus="operationName"
                                           var="operationNameBefore">
                                    <tr>
                                        <td>
                                                <%--<form:hidden path="operationNameApplys[${operationName.index}].orgId"/>--%>
                                                <%--<form:hidden path="operationNameApplys[${operationName.index}].id"></form:hidden>--%>

                                                <form:input path="operationNameApplys[${operationName.index}].operationName" class="form-control" readonly="true" cssStyle="border: none;margin:0;"/>
                                                    <form:input path="operationNameApplys[${operationName.index}].operationId" class="form-control" type="hidden" cssStyle="border: none;margin:0;"/>

                                        </td>
                                           <%-- <td>
                                                <form:hidden path="operationNameApplys[${operationName.index}].orgId"/>
                                                <form:hidden path="operationNameApplys[${operationName.index}].id"></form:hidden>

                                                <form:input path="operationNameApplys[${operationName.index}].operationName" class="form-control" readonly="true" cssStyle="border: none;margin:0;"/>
                                                <form:input path="operationNameApplys[${operationName.index}].operationId" class="form-control" type="hidden" cssStyle="border: none;margin:0;"/>

                                            </td>--%>
                                        <td class="col-sm-5">
                                            <select name="operationNameBefores[${operationName.index}].operationScale"
                                                    class="form-control" >
                                                <c:forEach items="${fns:getDictList('OPERATION_SCALE')}"
                                                           var="type">
                                                    <c:choose>
                                                        <c:when test="${type.value==operationNameBefore.operationScale}">
                                                            <option value="${type.value}"
                                                                    selected="selected">${type.label}</option>
                                                        </c:when>
                                                        <c:otherwise>
                                                            <option value="${type.value}">${type.label}</option>
                                                        </c:otherwise>
                                                    </c:choose>

                                                </c:forEach>
                                            </select>
                                        </td>
                                        <td>
                                            <select name="operationNameBefores[${operationName.index}].woundGrade"
                                                    class="form-control">
                                                <c:forEach items="${fns:getDictList('WOUND_GRADE_DICT')}"
                                                           var="type">
                                                <c:choose>
                                                <c:when test="${type.value==operationNameBefore.woundGrade}">
                                                <option value="${type.value}"
                                                        selected="selected">${type.label}</option>
                                                </c:when>
                                                <c:otherwise>
                                                <option value="${type.value}">${type.label}</option>
                                                </c:otherwise>
                                                </c:choose>

                                                </c:forEach>
                                        </td>
                                        <td>
                                            <button type="button" class="btn btn-danger"
                                                    onclick="delOperationApply(this)">删除
                                            </button>
                                        </td>
                                    </tr>
                                </c:forEach>
                            </c:if>
                            <!--手术修改-->
                            <c:if test="${operationState=='1'}">
                                <c:forEach items="${operationSchedule.operationNameBefores}"
                                           varStatus="operationName"
                                           var="operationNameBefore">
                                    <tr>
                                        <td>
                                            <form:hidden path="operationNameBefores[${operationName.index}].orgId"/>
                                            <form:hidden
                                                    path="operationNameBefores[${operationName.index}].id"></form:hidden>
                                            <form:input path="operationNameBefores[${operationName.index}].operationName" class="form-control" data-parsley-required="true" readonly="true" cssStyle="border: none;margin:0;"/>
                                            <form:input path="operationNameBefores[${operationName.index}].operationId" class="form-control" type="hidden" cssStyle="border: none;margin:0;"/>

                                        </td>


                                        <td>
                                            <form:select data-parsley-validate=""
                                                         path="operationNameBefores[${operationName.index}].operationScale"
                                                         class="form-control" data-parsley-required=""
                                                         cssStyle="border: none;margin:0;">
                                                <option value="" label="" selected="selected"/>
                                                <c:forEach items="${fns:getDictList('OPERATION_SCALE')}" var="type">
                                                    <c:choose>
                                                        <c:when test="${type.value==operationNameBefore.operationScale}">
                                                            <option value="${type.value}"
                                                                    selected="selected">${type.label}</option>
                                                        </c:when>
                                                        <c:otherwise>
                                                            <option value="${type.value}">${type.label}</option>
                                                        </c:otherwise>
                                                    </c:choose>

                                                </c:forEach>
                                            </form:select>
                                        </td>
                                        <td>
                                            <select name="operationNameBefores[${operationName.index}].woundGrade"
                                                    class="form-control">
                                                <c:forEach items="${fns:getDictList('WOUND_GRADE_DICT')}"
                                                           var="type">
                                                    <c:choose>
                                                        <c:when test="${type.value==operationNameBefore.woundGrade}">
                                                            <option value="${type.value}"
                                                                    selected="selected">${type.label}</option>
                                                        </c:when>
                                                        <c:otherwise>
                                                            <option value="${type.value}">${type.label}</option>
                                                        </c:otherwise>
                                                    </c:choose>

                                                </c:forEach>
                                            </select>
                                        </td>
                                        <td>
                                            <button type="button" class="btn btn-danger"
                                                    onclick="delOperationApply(this)">删除
                                            </button>
                                        </td>
                                    </tr>
                                </c:forEach>
                            </c:if>

                            </tbody>
                        </table>
                        <div class="button_position">
                            <div class="pull-right">
                                <button type="button" class="btn btn-primary" onclick="addOperationSchedule(this)">
                                    新增
                                </button>
                            </div>
                        </div>
                    </fieldset>
                    <fieldset>
                        <legend><img src="${ctxStatic}/images/left.png" class="pull-left mt8">手术基本信息<img
                                src="${ctxStatic}/images/right.png" class="pull-right mt8"></legend>
                        <div class="col-lg-12">
                            <div class="form-group col-sm-12">
                                <label class="col-sm-2 control-label">术前诊断：</label>

                                <div class="col-sm-10">
                                    <form:textarea path="diagBeforeOperation" value="${operationSchedule.diagBeforeOperation}"  data-parsley-required="true" htmlEscape="false"
                                                   maxlength="2000" class="form-control"/>
                                </div>
                            </div>
                            <div class="form-group col-sm-6">
                                <label class="col-sm-4 control-label">开单科室：</label>

                                <div class="col-sm-8">
                                   <%-- <sys:treeselect selectedParent="true" id="orgDeptId" name="operationDeptId" value="${operationSchedule.operationDeptId}"  update="${not empty orgDept.id}" labelName="${operationSchedule.operationName}" labelValue="${operationSchedule.operationName}"
                                                     title="科室" url="/sys/orgDept/treeData" extId="${orgDept.id}" cssClass="form-control" isnull="true"/>
                                --%>
                                       <form:hidden path="operationDeptId" id="orgDeptRightId" name="operationDeptId" value="${operationSchedule.operationDeptId}"></form:hidden>
                                       <input  class="form-control" id="orgDeptName" value="${operationSchedule.operationName}" type="text" readonly="true"   />
                                </div>
                            </div>
                            <div class="form-group col-sm-6">
                                <label class="col-sm-4 control-label">开单医生：</label>

                                <div class="col-sm-8">
                                   <%-- <form:hidden path="doctorUser" id="kdDoctor"></form:hidden>
                                    <input  class="form-control" id="kdDoctorNames" value="${operationSchedule.doctorName}" type="text" onclick="assignButton('kdDoctorNames','kdDoctor')" placeholder="分配人员"/>--%>
                                    <form:hidden path="doctorUser" id="kdDoctor" value="${operationSchedule.doctorUser}"></form:hidden>
                                        <%--<input  class="form-control" id="kdDoctorNames" value="${operationApply.doctorName}" type="text" onclick="assignButton('kdDoctorNames','kdDoctor')" placeholder="分配人员"/>--%>
                                    <input  class="form-control" id="kdDoctorNames" value="${operationSchedule.doctorName}" type="text" readonly="true" />
                                </div>
                            </div>
                            <%--<div class="form-group col-sm-6">--%>
                                <%--<label class="col-sm-4 control-label">预约时间：</label>--%>

                                <%--<div class="col-sm-8">--%>
                                    <%--<fmt:formatDate value="${operationSchedule.makeDate}"--%>
                                                    <%--pattern="yyyy-MM-dd HH:mm:ss" var="date"/>--%>
                                    <%--<input name="makeDate" htmlEscape="false" class="form-control Wdate"--%>
                                           <%--data-parsley-required="true" readonly--%>
                                           <%--onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"--%>
                                           <%--value="${date}"/>--%>
                                <%--</div>--%>
                            <%--</div>--%>
                            <div class="form-group col-sm-6">
                                <label class="col-sm-4 control-label">手术时间：</label>

                                <div class="col-sm-8">
                                    <fmt:formatDate value="${operationSchedule.scheduledDate}"
                                                    pattern="yyyy-MM-dd HH:mm:ss" var="date"/>
                                    <input name="scheduledDate" htmlEscape="false" class="form-control Wdate"
                                           data-parsley-required="true" readonly
                                           onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"
                                           value="${date}"/>
                                </div>
                            </div>
                            <div class="form-group col-sm-6">
                                <label class="col-sm-4 control-label">手术室：</label>
                                <div class="col-sm-8">
                                    <sys:treeselect method="changeOperatonRoom" selectedParent="true" id="operatingRoomId" name="operatingRoomId" value="${operationSchedule.operatingRoomId}"  update="${not empty orgDept.id}" labelName="${operationSchedule.operatingRoomName}" labelValue="${operationSchedule.operatingRoomName}"
                                                    allowInput="false"    title="科室" url="/sys/orgDept/treeData" extId="${orgDept.id}" cssClass="form-control" isnull="true"/>
                                       <%-- <form:hidden path="operatingRoomId" id="operatingRoomId" name="operatingRoomId" value="${operationSchedule.operatingRoomId}"></form:hidden>
                                        <input  class="form-control" id="operatingRoomName" value="${operationSchedule.operatingRoomName}" type="text" readonly="true"   />
                               --%> </div>
                            </div>
                            <div class="form-group col-sm-6">
                                <label class="col-sm-4 control-label">手术间：</label>

                                <div class="col-sm-8">
                                    <form:select data-parsley-validate=""
                                                 path="operatingRoomNo"
                                                 class="form-control" data-parsley-required="true"
                                                 cssStyle="border: none;margin:0;">
                                        <option value="" label=""/>
                                        <%--<c:forEach items="${operationRoomList.list}" var="operationRoom">--%>
                                            <%--<form:option value="${operationRoom.id}" itemLabel="label"--%>
                                                         <%--itemValue="value" htmlEscape="false">--%>
                                                <%--${operationRoom.roomNo}--%>
                                            <%--</form:option>--%>
                                        <%--</c:forEach>--%>
                                    </form:select>
                                </div>
                            </div>
                            <div class="form-group col-sm-6">
                                <label class="col-sm-4 control-label">隔离等级：</label>

                                <div class="col-sm-8">

                                    <form:select path="isolationIndicator" class="form-control"
                                                 data-parsley-required="true" cssStyle="border: none;margin:0;">
                                        <form:option value="" label=""/>
                                        <form:options items="${fns:getDictList('QUARANTINE_MARK')}"
                                                      itemLabel="label"
                                                      itemValue="value" htmlEscape="false"/>
                                    </form:select>
                                </div>
                            </div>
                            <form:hidden path="inoroutFlag"/>
                            <div class="form-group col-sm-6">
                                <label class="col-sm-4 control-label">输/供血方式：</label>

                                <div class="col-sm-8">
                                    <form:select path="provideWay"
                                                 class="form-control"
                                                 cssStyle="border: none;margin:0;">
                                        <form:option value="" label=""/>
                                        <form:options items="${fns:getDictList('BLOOD_SUPPLY_WAY')}"
                                                      itemLabel="label"
                                                      itemValue="value" htmlEscape="false"/>
                                    </form:select>
                                </div>
                            </div>
                            <div class="form-group col-sm-6">
                                <label class="col-sm-4 control-label">病情：</label>

                                <div class="col-sm-8">
                                    <form:select path="patientCondition"
                                                 class="form-control" data-parsley-required="true"
                                                 cssStyle="border: none;margin:0;">
                                        <form:option value="" label=""/>
                                        <form:options items="${fns:getDictList('PATIENT_CONDITION')}"
                                                      itemLabel="label"
                                                      itemValue="value" htmlEscape="false"/>
                                    </form:select>
                                </div>
                            </div>
                            <div class="form-group col-sm-6">
                                <label class="col-sm-4 control-label">麻醉方式：</label>

                                <div class="col-sm-8">
                                    <form:select path="anesthesiaMethod"
                                                 class="form-control"
                                                 cssStyle="border: none;margin:0;">
                                        <form:option value="" label=""/>
                                        <form:options items="${fns:getDictList('ANESTHESIA_METHOD')}"
                                                      itemLabel="label"
                                                      itemValue="value" htmlEscape="false"/>
                                    </form:select>
                                </div>
                            </div>
                            <div class="form-group col-sm-6">
                                <label class="col-sm-4 control-label">是否急诊：</label>

                                <div class="col-sm-8">
                                    <form:select path="emergencyFlag"
                                                 class="form-control" data-parsley-required="true"
                                                 cssStyle="border: none;margin:0;">
                                        <form:option value="" label=""/>
                                        <form:options items="${fns:getDictList('EMERGENCY_FLAG')}" itemLabel="label"
                                                      itemValue="value" htmlEscape="false"/>
                                    </form:select>
                                </div>
                            </div>
                        </div>
                    </fieldset>
                    <c:if test="${operationState=='0'}">
                    <fieldset>
                        <legend><img src="${ctxStatic}/images/left.png" class="pull-left mt8">手术人员信息<img
                                src="${ctxStatic}/images/right.png" class="pull-right mt8"></legend>
                        <div class="col-sm-12">
                            <div class="form-group col-sm-6">
                                <label class="col-sm-4 control-label">主刀医生：</label>

                                <div class="col-sm-8">
                                    <input type="hidden" name="zdStaffBefore.userId" value="${operationSchedule.zdStaffApply.userId}" id="zdDoctors"/>
                                    <input type="hidden" name="zdStaffBefore.operationLocal" value="0"
                                           class="form-control" />
                                    <input data-parsley-required="true" class="form-control" id="zdName" value="${operationSchedule.zdStaffApply.userNames}"  type="text" onclick="assignButton('zdName','zdDoctors')" placeholder="分配人员"/>
                                </div>
                            </div>
                            <div class="form-group col-sm-6">
                                <label class="col-sm-4 control-label">麻醉医生：</label>

                                <div class="col-sm-8">
                                    <input type="hidden" name="myStaffBefore.userId" value="${operationSchedule.myStaffApply.userId}" id="myDoctors"/>
                                    <input name="myStaffBefore.operationLocal" value="1"  class="form-control" type="hidden"/>
                                    <input  class="form-control" id="myName" value="${operationSchedule.myStaffApply.userNames}"  type="text" onclick="assignButton('myName','myDoctors')" placeholder="分配人员"/>
                                </div>
                            </div>
                            <div class="form-group col-sm-6">
                                <label class="col-sm-4 control-label">输血医生：</label>

                                <div class="col-sm-8">
                                    <input type="hidden" name="sxStaffBefore.userIds" value="${operationSchedule.sxStaffApply.userIds}" id="sxDoctors"/>
                                    <input name="sxStaffBefore.operationLocal" value="2"  class="form-control" type="hidden"/>
                                    <input  class="form-control" id="sxNames" value="${operationSchedule.sxStaffApply.userNames}" type="text" onclick="assignButton('sxNames','sxDoctors')" placeholder="分配人员"/>
                                </div>
                            </div>

                            <div class="form-group col-sm-6">
                                <label class="col-sm-4 control-label">麻醉助手：</label>

                                <div class="col-sm-8">
                                    <input type="hidden" name="mzStaffBefore.userIds" id="mzDoctors"  value="${operationSchedule.mzStaffApply.userIds}"/>
                                    <input name="mzStaffBefore.operationLocal" value="3"  class="form-control" type="hidden"/>
                                    <input  class="form-control" id="mzNames" value="${operationSchedule.mzStaffApply.userNames}" type="text" onclick="assignButton('mzNames','mzDoctors')" placeholder="分配人员"/>
                                </div>
                            </div>
                            <div class="form-group col-sm-12">
                                <label class="col-sm-2 control-label">医生助手：</label>
                                <div class="col-sm-8">
                                    <input type="hidden" name="yzStaffBefore.userIds" id="yzDoctors" value="${operationSchedule.yzStaffApply.userIds}"/>
                                    <input name="yzStaffBefore.operationLocal" value="4"  class="form-control" type="hidden"/>
                                    <input data-parsley-required="true" class="form-control" id="yzNames" value="${operationSchedule.yzStaffApply.userNames}" type="text" onclick="assignButton('yzNames','yzDoctors')" placeholder="分配人员"/>
                                </div>
                            </div>
                            <div class="form-group col-sm-12">
                                <label class="col-sm-2 control-label">上台护士：</label>
                                <div class="col-sm-8">
                                    <input type="hidden" name="stStaffBefore.userIds" id="stDoctors"  value="${operationSchedule.stStaffApply.userIds}"/>
                                    <input name="stStaffBefore.operationLocal" value="5"  class="form-control" type="hidden"/>
                                    <input  class="form-control" id="stNames" value="${operationSchedule.stStaffApply.userNames}" type="text" onclick="assignButton('stNames','stDoctors')" placeholder="分配人员"/>
                                </div>
                            </div>
                            <div class="form-group col-sm-12">
                                <label class="col-sm-2 control-label">供应护士：</label>
                                <div class="col-sm-8">
                                    <input type="hidden" name="gyStaffBefore.userIds" value="${operationSchedule.gyStaffApply.userIds}" id="gyDoctors"/>
                                    <input name="gyStaffBefore.operationLocal" value="6"  class="form-control" type="hidden"/>
                                    <input  class="form-control" id="gyNames" value="${operationSchedule.gyStaffApply.userNames}" type="text" onclick="assignButton('gyNames','gyDoctors')" placeholder="分配人员"/>
                                </div>
                            </div>
                        </div>
                    </fieldset>
                    </c:if>
                    <c:if test="${operationState=='1'}">
                    <fieldset>
                        <legend><img src="${ctxStatic}/images/left.png" class="pull-left mt8">手术人员信息<img
                                src="${ctxStatic}/images/right.png" class="pull-right mt8"></legend>
                        <div class="col-sm-12">
                            <div class="form-group col-sm-6">
                                <label class="col-sm-4 control-label">主刀医生：</label>

                                <div class="col-sm-8">
                                    <form:hidden path="zdStaffBefore.userId" id="zdDoctor"></form:hidden>
                                    <input type="hidden" name="zdStaffBefore.operationLocal" value="0"
                                           class="form-control"/>
                                    <input  class="form-control" id="zdDoctorName" value="${operationSchedule.zdStaffBefore.userNames}"  type="text" onclick="assignButton('zdDoctorName','zdDoctor')" placeholder="分配人员"/>
                                </div>
                            </div>
                            <div class="form-group col-sm-6">
                                <label class="col-sm-4 control-label">麻醉医生：</label>

                                <div class="col-sm-8">
                                    <form:hidden path="myStaffBefore.userId" id="myDoctor"></form:hidden>
                                    <input name="myStaffBefore.operationLocal" value="1"  class="form-control" type="hidden"/>
                                    <input  class="form-control" id="myDoctorName" value="${operationSchedule.myStaffBefore.userNames}"  type="text" onclick="assignButton('myDoctorName','myDoctor')" placeholder="分配人员"/>
                                </div>
                            </div>
                            <div class="form-group col-sm-6">
                                <label class="col-sm-4 control-label">输血医生：</label>

                                <div class="col-sm-8">
                                    <form:hidden path="sxStaffBefore.userIds" id="sxDoctor"></form:hidden>
                                    <input name="sxStaffBefore.operationLocal" value="2"  class="form-control" type="hidden"/>
                                    <input  class="form-control" id="sxDoctorNames" value="${operationSchedule.sxStaffBefore.userNames}" type="text" onclick="assignButton('sxDoctorNames','sxDoctor')" placeholder="分配人员"/>
                                </div>
                            </div>

                            <div class="form-group col-sm-6">
                                <label class="col-sm-4 control-label">麻醉助手：</label>

                                <div class="col-sm-8">
                                    <form:hidden path="mzStaffBefore.userIds" id="mzDoctor"></form:hidden>
                                    <input name="mzStaffBefore.operationLocal" value="3"  class="form-control" type="hidden"/>
                                    <input  class="form-control" id="mzDoctorNames" value="${operationSchedule.mzStaffBefore.userNames}" type="text" onclick="assignButton('mzDoctorNames','mzDoctor')" placeholder="分配人员"/>
                                </div>
                            </div>
                            <div class="form-group col-sm-12">
                                <label class="col-sm-2 control-label">医生助手：</label>
                                <div class="col-sm-8">
                                    <form:hidden path="yzStaffBefore.userIds" id="yzDoctor"></form:hidden>
                                    <input name="yzStaffBefore.operationLocal" value="4"  class="form-control" type="hidden"/>
                                    <input  class="form-control" id="yzDoctorNames" value="${operationSchedule.yzStaffBefore.userNames}" type="text" onclick="assignButton('yzDoctorNames','yzDoctor')" placeholder="分配人员"/>
                                </div>
                            </div>
                            <div class="form-group col-sm-12">
                                <label class="col-sm-2 control-label">上台护士：</label>
                                <div class="col-sm-8">
                                    <form:hidden path="stStaffBefore.userIds" id="stDoctor"></form:hidden>
                                    <input name="stStaffBefore.operationLocal" value="5"  class="form-control" type="hidden"/>
                                    <input  class="form-control" placeholder="分配人员" id="stDoctorNames" value="${operationSchedule.stStaffBefore.userNames}" type="text" onclick="assignButton('stDoctorNames','stDoctor')"/>
                                </div>
                            </div>
                            <div class="form-group col-sm-12">
                                <label class="col-sm-2 control-label">供应护士：</label>
                                <div class="col-sm-8">
                                    <form:hidden path="gyStaffBefore.userIds" id="gyDoctor"></form:hidden>
                                    <input name="gyStaffBefore.operationLocal" value="6"  class="form-control" type="hidden"/>
                                    <input  class="form-control" id="gyDoctorNames" value="${operationSchedule.gyStaffBefore.userNames}" type="text" onclick="assignButton('gyDoctorNames','gyDoctor')" placeholder="分配人员"/>
                                </div>
                            </div>
                        </div>
                    </fieldset>
                    </c:if>

                    <div class="form-group" style="margin-top: 15px;margin-left: 10px">
                        <div class="col-sm-10">
                            <input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存">&nbsp;
                            <input id="btnCancel" class="btn" type="button" value="返 回"
                                   onclick="loadDiv('mainCenterDiv','${ctx}/operation/operationSchedule/index')">
                        </div>
                    </div>
                    </form:form>
            </div>
        </section>
    </div>
    </section>
</div>
</div>



